package com.kevin;

import com.kevin.service.UserService;
import org.mybatis.spring.KevinFactoryBean;
import org.mybatis.spring.KevinImportBeanDefinitionRegistrar;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

@ComponentScan("com.kevin")
@Import(KevinImportBeanDefinitionRegistrar.class)
public class Main {

    public static void main(String[] args) {

        // 配置Spring
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        applicationContext.register(Main.class);


        applicationContext.refresh();
        UserService userService = applicationContext.getBean("userService", UserService.class);
        userService.test();

    }
}
